package com.yowasa.xiuxian.engine.battle.buff;

import com.yowasa.xiuxian.annoations.Buff;
import com.yowasa.xiuxian.entity.bo.battle.BattleContent;
import com.yowasa.xiuxian.entity.bo.battle.BuffContent;
import com.yowasa.xiuxian.entity.bo.battle.TempUserBattle;
import com.yowasa.xiuxian.entity.bo.battle.UserBattleContent;


@Buff(name = "水幕")
public class ShuiMuBuff implements BuffInterface {


    @Override
    public void effectBattleInfo(BuffContent content, TempUserBattle userBattle) {
        userBattle.setSpd((int) (userBattle.getSpd() * 0.7));
    }

    @Override
    public void beforeBuffAction(UserBattleContent first, UserBattleContent second, BattleContent content) {
        int atk = second.getBattleInfo().getSpell();
        int dmg = (int) (atk * 0.3);
        first.getBattleInfo().setChp(first.getBattleInfo().getChp() - dmg);
        content.getMsgLog().add(first.getUserBO().getName() + "因水幕天河场地环境失去了" + dmg + "点血");
    }

}
